import java.sql.*;
import java.util.ResourceBundle;

public class CountTableRows {

    static ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("db_config");

    public static Connection getConnect() throws SQLException {
        String username = RESOURCE_BUNDLE.getString("username");
        String password = RESOURCE_BUNDLE.getString("password");
        String url = RESOURCE_BUNDLE.getString("url");
        return DriverManager.getConnection(url, username, password);
    }


    public static void main(String[] args) throws SQLException {


        Connection connect = DriverManager.getConnection("jdbc:postgresql://172.16.55.184:5432/vastbase?db_compatibility=oracle", "zxs", "Aa123456");
        String sql = "select col1, col2 as acol2 from t1";
        Statement statement = connect.createStatement();
        ResultSet resultSet = statement.executeQuery(sql);

        while (resultSet.next()) {
            System.out.println(resultSet.getString(1) );
        }

    }
}
